home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d16 / nodee1a.arc / SOURCE.ARC / FILE.H < prev    next >
C/C++ Source or Header  |  1991-09-20  |  2KB  |  63 lines

  1.     #ifndef __FILE_H
  2.     #define __FILE_H
  3.  
  4.     #ifndef __DIR_H
  5.         #include <dir.h>
  6.     #endif
  7.  
  8. /*---------------------------------------------------------
  9. FileName class
  10.  
  11. used to deal with disk files
  12.  
  13. PUBLIC:
  14.  
  15.     BOOL SetFile(char *) - set the file name to the passed string.  The
  16.             file must be on the current directory, or the PATH.  If the filename
  17.             contains a drive indication (A:, B:, etc) the drive is changed first.
  18.             Returns    TRUE if the file is found, FALSE otherwise.
  19.  
  20.     BOOL ValidFile(void) - returns TRUE if the current filename is of
  21.             a valid disk file.
  22.  
  23.     char* JustName(void) - returns only the name of the current file, not
  24.             the path.
  25.  
  26.     char* ShortName(int n) - returns the full file name shortened to n
  27.             characters.    Subdirectories are removed from the beginning of
  28.             the full file name until the length is less than or equal to n.
  29.             "..." is prepended to the returned string to indicate part of the
  30.             path has been dropped.
  31.  
  32.     char* LongName(void) - returns the fully qualified file name.
  33.  
  34. PROTECTED:
  35.  
  36.     BOOL bValidFile - TRUE if the current file is valid.
  37.     char szFullQFile[] - the fully qualified file name.
  38.  
  39. -----------------------------------------------------------*/
  40.  
  41.  
  42.     class FileName
  43.     {
  44.     public:
  45.         BOOL SetFile(char *);
  46.  
  47.         BOOL ValidFile(void);
  48.         char * JustName(void);
  49.         char * ShortName(int);
  50.         char * LongName(void);
  51.  
  52.     protected:
  53.         BOOL bValidFile;
  54.         char szFullQFile[MAXPATH];
  55.  
  56.     private:
  57.         char szFile[MAXPATH];
  58.         char szShortFile[MAXPATH];
  59.     };
  60.  
  61.     #endif
  62.  
  63.